package com.atguigu.springcloud.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.Message;

import java.util.function.Consumer;

@Configuration
public class StreamConfig {
    @Bean
    public Consumer<Message<String>> consumer(@Value("${server.port}") String port) {
        return message -> {
            System.out.println(message.getPayload());
            System.out.println(port);
        };
    }
}
